const MD5 = require('js-md5');

export function XMMD5Encrypt(outputtemp) {
	let strOutput = [];
	let arr = [];
	outputtemp = MD5(outputtemp).toUpperCase();
	console.log(outputtemp, '原生MD5');
	for (var i = 0; i <= 15; i++) {
		let str = outputtemp[2 * i] + outputtemp[2 * i + 1];
		arr.push(str)
	}
	for (var j = 0; j <= 7; j++) {
		strOutput[j] = ((parseInt(arr[2 * j], 16) + parseInt(arr[2 * j + 1], 16)) % 62)
		if ((strOutput[j] >= 0) && (strOutput[j] <= 9)) {
			strOutput[j] += 48;
		} else {
			if ((strOutput[j] >= 10) && (strOutput[j] <= 35)) {
				strOutput[j] += 55;
			} else {
				strOutput[j] += 61;
			}
		}
	}
	var n = String.fromCharCode(
		strOutput[0],
		strOutput[1],
		strOutput[2],
		strOutput[3],
		strOutput[4],
		strOutput[5],
		strOutput[6],
		strOutput[7]);
	console.log(n)
	return n
};
